<?php if(!defined('PUBLIC_DIR')) die('No Access!');

Cnamespace('System');
abstract class Dispather implements iDispather {
	public static function Invoke(Action $action, array $Params = array()){
		if(!$action->hasReflectionMethodInstance() && $action->hasMethod())
			return call_user_func_array($action->getMethod(), $Params);
		else if($action->hasReflectionMethodInstance())
			if($action->getReflectionMethodInstance()->isStatic() === True)
				return call_user_func_array(array($action->getObjectInstance(), $action->getMethod()), $Params);
			else
				return $action->getReflectionMethodInstance()->invokeArgs($action->getObjectInstance(), $Params);
	}
}
